/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.facturacion.vista;

import isd.inventario.modelo.ST_Producto;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "pdpend")
@IdClass(FC_ItemPendientePK.class)
public class FC_ItemPendiente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "PDRMVI_MODAPL", length = 2)
    private String modapl;
    @Id
    @Column(name = "PDRMVI_CODAPL", length = 6)
    private String codapl;
    @Id
    @Column(name = "PDRMVI_NROAPL")
    private Integer nroapl;
    @Id
    @Column(name = "PDRMVI_ITMAPL")
    private Integer itmapl;
    @Id
    @Column(name = "PDRMVI_NIVAPL", length = 2)
    private String nivapl;
    @Id
    @Column(name = "PDRMVI_EXPAPL")
    private Integer expapl;

    @JoinColumns({
    @JoinColumn(name = "PDRMVI_TIPORI", referencedColumnName = "STMPDH_TIPPRO", nullable = false),
    @JoinColumn(name = "PDRMVI_ARTORI", referencedColumnName = "STMPDH_ARTCOD", nullable = false)
    })
    @ManyToOne(optional=false, fetch=FetchType.LAZY)
    private ST_Producto producto;

    @Column(name = "STMPDH_DESCRP", nullable = false, length = 120)
    private String descrp;
    @Column(name = "PDRMVI_SUCURS", length = 6)
    private String sucurs;
    @Column(name = "PDRMVI_UNIMED", length = 6)
    private String unimed;
    @Column(name = "PDRMVI_TIPAPL", length = 6)
    private String tipapl;
    @Column(name = "PDRMVI_ARTAPL", length = 30)
    private String artapl;
    @Column(name = "PDRMVI_FORAPL", length = 8)
    private String forapl;
    @Column(name = "PDRMVI_STOCKS", length = 1)
    private String stocks;
    @Column(name = "PDRMVH_CIRCOM", length = 6)
    private String circom;
    @Column(name = "PENDIENTE", precision = 2, scale = 10)
    private BigDecimal cantid;

    @Column(name = "PDRMVI_MODORI", length = 2)
    private String modori;

    @Column(name = "PDRMVI_CODORI", length = 6)
    private String codori;

    @Column(name = "PDRMVI_NROORI")
    private Integer nroori;


    @JoinColumns({
    @JoinColumn(name = "PDRMVI_MODAPL", referencedColumnName = "PDRMVI_MODAPL", nullable = false, insertable=false, updatable=false),
    @JoinColumn(name = "PDRMVI_CODAPL", referencedColumnName = "PDRMVI_CODAPL", nullable = false, insertable=false, updatable=false),
    @JoinColumn(name = "PDRMVI_NROAPL", referencedColumnName = "PDRMVI_NROAPL", nullable = false, insertable=false, updatable=false),
    @JoinColumn(name = "PDRMVH_CIRCOM", referencedColumnName = "PDRMVH_CIRCOM", nullable = false, insertable=false, updatable=false)
    })
    @ManyToOne
    private FC_MovimientoPendiente movimiento;

    @Transient
    private boolean seleccionado;

    public FC_ItemPendiente() {
    }

    public String getArtapl() {
        return artapl;
    }

    public void setArtapl(String artapl) {
        this.artapl = artapl;
    }

    public ST_Producto getProducto() {
        return producto;
    }

    public void setProducto(ST_Producto producto) {
        this.producto = producto;
    }

    public BigDecimal getCantid() {
        return cantid;
    }

    public void setCantid(BigDecimal cantid) {
        this.cantid = cantid;
    }

    public String getCircom() {
        return circom;
    }

    public void setCircom(String circom) {
        this.circom = circom;
    }

    public String getCodapl() {
        return codapl;
    }

    public void setCodapl(String codapl) {
        this.codapl = codapl;
    }

    public String getDescrp() {
        return descrp;
    }

    public void setDescrp(String descrp) {
        this.descrp = descrp;
    }

    public Integer getExpapl() {
        return expapl;
    }

    public void setExpapl(Integer expapl) {
        this.expapl = expapl;
    }

    public String getForapl() {
        return forapl;
    }

    public void setForapl(String forapl) {
        this.forapl = forapl;
    }

    public Integer getItmapl() {
        return itmapl;
    }

    public void setItmapl(Integer itmapl) {
        this.itmapl = itmapl;
    }

    public String getModapl() {
        return modapl;
    }

    public void setModapl(String modapl) {
        this.modapl = modapl;
    }

    public String getNivapl() {
        return nivapl;
    }

    public void setNivapl(String nivapl) {
        this.nivapl = nivapl;
    }

    public Integer getNroapl() {
        return nroapl;
    }

    public void setNroapl(Integer nroapl) {
        this.nroapl = nroapl;
    }

    public String getStocks() {
        return stocks;
    }

    public void setStocks(String stocks) {
        this.stocks = stocks;
    }

    public String getSucurs() {
        return sucurs;
    }

    public void setSucurs(String sucurs) {
        this.sucurs = sucurs;
    }

    public String getTipapl() {
        return tipapl;
    }

    public void setTipapl(String tipapl) {
        this.tipapl = tipapl;
    }

    public String getUnimed() {
        return unimed;
    }

    public void setUnimed(String unimed) {
        this.unimed = unimed;
    }

    public FC_MovimientoPendiente getMovimiento() {
        return movimiento;
    }

    public void setMovimiento(FC_MovimientoPendiente movimiento) {
        this.movimiento = movimiento;
    }

    public boolean isSeleccionado() {
        return seleccionado;
    }

    public void setSeleccionado(boolean seleccionado) {
        this.seleccionado = seleccionado;
    }

    public String getCodori() {
        return codori;
    }

    public void setCodori(String codori) {
        this.codori = codori;
    }

    public String getModori() {
        return modori;
    }

    public void setModori(String modori) {
        this.modori = modori;
    }

    public Integer getNroori() {
        return nroori;
    }

    public void setNroori(Integer nroori) {
        this.nroori = nroori;
    }
    

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final FC_ItemPendiente other = (FC_ItemPendiente) obj;
        if ((this.modapl == null) ? (other.modapl != null) : !this.modapl.equals(other.modapl)) {
            return false;
        }
        if ((this.codapl == null) ? (other.codapl != null) : !this.codapl.equals(other.codapl)) {
            return false;
        }
        if (this.nroapl != other.nroapl && (this.nroapl == null || !this.nroapl.equals(other.nroapl))) {
            return false;
        }
        if (this.itmapl != other.itmapl && (this.itmapl == null || !this.itmapl.equals(other.itmapl))) {
            return false;
        }
        if ((this.nivapl == null) ? (other.nivapl != null) : !this.nivapl.equals(other.nivapl)) {
            return false;
        }
        if (this.expapl != other.expapl && (this.expapl == null || !this.expapl.equals(other.expapl))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 29 * hash + (this.modapl != null ? this.modapl.hashCode() : 0);
        hash = 29 * hash + (this.codapl != null ? this.codapl.hashCode() : 0);
        hash = 29 * hash + (this.nroapl != null ? this.nroapl.hashCode() : 0);
        hash = 29 * hash + (this.itmapl != null ? this.itmapl.hashCode() : 0);
        hash = 29 * hash + (this.nivapl != null ? this.nivapl.hashCode() : 0);
        hash = 29 * hash + (this.expapl != null ? this.expapl.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "PD_ItemPendiente{" + "modapl=" + modapl + "codapl=" + codapl + "nroapl=" + nroapl + "itmapl=" + itmapl + "nivapl=" + nivapl + "expapl=" + expapl + '}';
    }

    
    
}
